package com.huage.xml;

import cn.wanghaomiao.xpath.exception.XpathSyntaxErrorException;
import cn.wanghaomiao.xpath.model.JXDocument;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;


import java.io.File;
import java.io.IOException;
import java.util.List;

public class JsoupXpath {
    public static void main(String[] args) throws IOException, XpathSyntaxErrorException {
        String path = JsoupDemo.class.getClassLoader().getResource("Users.xml").getPath();
        Document document = Jsoup.parse(new File(path), "UTF-8");
        JXDocument jxDocument = new JXDocument(document);

        List<Object> users = jxDocument.sel("//name");
        System.out.println(users);
    }
}
